package cn.kgc.shiro01.md5;

import org.apache.shiro.crypto.hash.Md5Hash;

/**
 * @Author: 课工场
 * @Version: v1.0  2023/4/1
 * @Description: shiro中支持的加密方式
 */
public class TestMD5 {


    public static void main(String[] args) {

        String  password = "123456";

        Md5Hash md5Hash = new Md5Hash(password);
        String md5Password = md5Hash.toHex();

        System.out.println("md5Password1 = " + md5Password);
        System.out.println("md5Password  len = " + md5Password.length());

        String salt = "hello";
        md5Hash = new Md5Hash(password,salt);
        md5Password = md5Hash.toHex();
        System.out.println("md5Password+salt = " + md5Password);


        md5Hash = new Md5Hash(password,salt,20);
        md5Password = md5Hash.toHex();
        System.out.println("md5Password+salt = " + md5Password);

    }

}
